package chapter1.exe;

import javax.lang.model.type.PrimitiveType;

public class FixedCapacityStackOfStrings {

	private String[] a;
	
	private int N;
	
	private int cap;
	
	public FixedCapacityStackOfStrings(int cap){
		this.cap=cap;
		a=new String[cap];
	}
	
	public boolean isEmpty(){
		return N==0;
	}
	
	public int size(){
		return N;
	}
	
	public void push(String item){
		a[N++]=item;
	}
	
	public String pop(){
		return a[--N];
	}
	
	boolean isFull(){
		return N==cap;
	}
	
}
